package edu.hdu.hangzhe.bytecode.domain;

import java.io.File;
import java.util.HashMap;

public class ByteCode {

    private final String className;
    private final HashMap<String, Method> methods;
    private final HashMap<String, Field> fields;

    public ByteCode(String className) {
        this.className = className;
        fields = new HashMap<>();
        methods = new HashMap<>();
    }

    public String getClassName() {
        return className;
    }

    public Method getMethod(String name) {
        return methods.get(name);
    }
    public HashMap<String, Method> getMethods() {
        return methods;
    }

    public void addMethod(String methodName, Method method) {
        this.methods.put(methodName, method);
    }

    public Field getField(String name) {
        return fields.get(name);
    }

    public void addField(String name, Field field) {
        this.fields.put(name, field);
    }

}
